class Animal:
    name = 'animal'

    #即使括号没有参数，也必须写上括号
    def shout(self):
        print('animal shout')


animal = Animal()
print(animal.name)
animal.shout()


class Dog:
    name = 'dog'

    #构造函数
    def __init__(self):
        self.age = 10

    def eat(self):
        print('dog eat')


dog = Dog()
print(dog.name)
dog.eat()
#类内属性可以直接调用，类更改属性
dog1 = Dog()
print(dog1.name)
print(Dog.name)
Dog.name = '__dd'
print('----------')
dog2 = Dog()
print(dog2.name)
print(dog1.age)
